{% extends './layout/default' %}

{% block breadcrumbs %}
    {{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
    <form action="{{ route('admin.update-check.post') }}" method="post" id="store" class="form-horizontal">

        <div class="row">

            <input type="hidden" name="_token" value="{{ csrf_token() }}"/>

            <div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">{{ 'admin_update_channel_title'|_ }}</h3>
                    </div>
                    <div class="box-body">
                        <p class="text-info">
                            {{ 'admin_update_channel_explain'|_ }}
                        </p>
                        {{ ExpandedForm.select('update_channel', channelOptions, channelSelected) }}
                    </div>
                </div>
            </div>

            {# do update check. #}
            <div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">{{ 'admin_update_check_title'|_ }}</h3>
                    </div>
                    <div class="box-body">
                        <p class="text-info">
                            {{ 'admin_update_check_explain'|_ }}
                        </p>
                        {{ ExpandedForm.select('check_for_updates',options, selected) }}
                    </div>
                </div>
            </div>

            {# check now button #}
            <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">{{ 'admin_update_check_now_title'|_ }}</h3>
                    </div>
                    <div class="box-body">
                        <p class="text-info">
                            {{ 'admin_update_check_now_explain'|_ }}
                        </p>
                        <p>
                            <a href="{{ route('admin.update-check.manual') }}" class="btn btn-info">{{ 'check_for_updates_button'|_ }}</a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                <button type="submit" class="btn btn-success">
                    {{ ('store_configuration')|_ }}
                </button>
            </div>
        </div>

    </form>

{% endblock %}
{% block scripts %}
    <script type="text/javascript" nonce="{{ JS_NONCE }}">
        var updateCheckUrl = '{{ route('admin.update-check.manual') }}';
    </script>
    <script type="text/javascript" src="v1/js/ff/admin/update/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
